<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>

<title>权限管理</title>
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<link rel="stylesheet"
	href="${pageContext.request.contextPath }/layui/css/layui.css">
<script src="${pageContext.request.contextPath }/layui/layui.js"></script>

</head>

<body>
	<fieldset class="layui-elem-field">
		<legend>权限管理</legend>
		<div class="layui-field-box">
			<div class="layui-form"></div>
		</div>
	</fieldset>
	<!-- 	数据表格 -->
	<table class="layui-hide" id="test" lay-filter="demo"></table>


	<script>
			layui.use('table', function() {

				var table = layui.table;
				var $ = layer.jquery;
				table.render({
					elem: '#test',
					data: ${comployees},
					cellMinWidth: 150 //全局定义常规单元格的最小宽度，layui 2.2.1 新增
						,
					cols: [
						[{
								field: 'comployeeName',
								width: 150,
								title: '用户名',
								sort: true
							}, {
								field: 'comployeeNo',
								width: 150,
								title: '员工编号'
							},
							{
								field:'address',
								title:'住址'
							},
							{
								field: 'comployeeNo',
								title: '操作',
								width: 178,
								align: 'center',
								toolbar: '#barDemo'
							}
						]
					],
					page: true
				});

				//监听工具条
				table.on('tool(demo)', function(obj) {
					var data = obj.data;
					if (obj.event === 'redirectPage') {
						window.location.href = '/findUserbyname?comployeeNo=' + obj.data.comployeeNo;
					}
					console.log(obj.data.comployeeNo)
				});
			});

		</script>
	<script type="text/html" id="barDemo">

			<a class="layui-btn layui-btn-primary layui-btn-xs"  lay-event="redirectPage">修改权限</a>
		</script>
</body>
</html>
